
-- Workspace KPBR ------------------------------

workspace "KPBR"
	architecture "x64"

	startproject "Offline"
	
	configurations {
		"Debug",
		"Release"
	}

	flags {
		"MultiProcessorCompile"
	}

outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"

-- KPBR ----------------------------------------

project "KPBR"
	location "KPBR"
	kind "StaticLib"
	language "C++"
	cppdialect "C++17"
	staticruntime "on"

	targetdir ("bin/" .. outputdir .. "/%{prj.name}")
	objdir ("bin-int/" .. outputdir .. "/%{prj.name}")

	pchheader "kppch.h"
	pchsource "KPBR/src/kppch.cpp"

	files {
		"%{prj.name}/src/**.h",
		"%{prj.name}/src/**.cpp",
	}

	includedirs {
		"%{prj.name}/src",
		"%{prj.name}/vendor/nlohmann",
	}

	filter "system:windows"
		systemversion "latest"

		defines {
			"KP_PLATFORM_WINDOWS",
		}

	filter "configurations:Debug"
		defines "KP_DEBUG"
		runtime "Debug"
		symbols "On"

	filter "configurations:Release"
		defines "KP_RELEASE"
		runtime "Release"
		optimize "On"

		
-- STB --------------------------------------

include "Offline/vendor/stb"

-- Offline --------------------------------------

project "Offline"
	location "Offline"
	kind "ConsoleApp"
	language "C++"
	cppdialect "C++17"
	staticruntime "on"
	
	targetdir ("bin/" .. outputdir .. "/%{prj.name}")
	objdir ("bin-int/" .. outputdir .. "/%{prj.name}")

	files {
		"%{prj.name}/src/**.h",
		"%{prj.name}/src/**.cpp"
	}

	includedirs {
		"KPBR/src",
		"%{prj.name}/vendor/stb",
	}

	links {
		"KPBR",
		"stb",
	}

	filter "system:windows"
		systemversion "latest"

		defines {
			"KP_PLATFORM_WINDOWS",
			
			"_CRT_SECURE_NO_WARNINGS",
			"STB_IMAGE_IMPLEMENTATION",
			"STB_IMAGE_WRITE_IMPLEMENTATION",
		}

	filter "configurations:Debug"
		defines "KP_DEBUG"
		runtime "Debug"
		symbols "On"

	filter "configurations:Release"
		defines "KP_RELEASE"
		runtime "Release"
		optimize "On"

